<template>
  <div>
    <el-card shadow="hover">
      <v-md-preview :text="text"></v-md-preview>
    </el-card>
  </div>
</template>
    
<script lang="ts">
import { defineComponent, onMounted, reactive, toRefs } from "vue";

export default defineComponent({
  name: "MdPreview",
  setup() {
    const state = reactive({
      text: "",
    });

    onMounted(() => {
      const text = localStorage.getItem("mdPreview:text");
      if (text) {
        state.text = text;
      }
    });

    return {
      ...toRefs(state),
    };
  },
});
</script>

<style scoped>
</style>